package liangtWorkSpace.singleDemo;

/**
 * @ClassName Mag01
 * @Description : 功能说明
 * @Author : LiangT
 * @Date : 2020/4/9 18:11
 */

/**
 * 单例模式一
 */
public class Mag07 {
    private Mag07(){}
    private static class Mag07Handle{
        private final static Mag07 INSTANCE = new Mag07();
    }

    public static Mag07 getMag01(){
        return Mag07Handle.INSTANCE;
    }
    public void m(){
        System.out.println("m");
    }

    public static void main(String[] args) {
        Mag07 mag01 = Mag07.getMag01();
        Mag07 mag02 = Mag07.getMag01();
        System.out.println(mag01 == mag02);
    }
}
